﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

namespace App1
{
    class Square
    {
        private int _row;
        private PictureBox _picCanMove;
        private int _side;
        private int _value;

        public int Value
        {
            get { return _value; }
            set { _value = value; }
        }
        private string _piece;
        private bool _state;
        private int _col;

        public int Row
        {
            get { return _row; }
            set { _row = value; }
        }

        public int Col
        {
            get { return _col; }
            set { _col = value; }
        }

        public bool State
        {
            get { return _state; }
            set { _state = value; }
        }

        public string Piece
        {
            get { return _piece; }
            set { _piece = value; }
        }

        public int Side
        {
            get { return _side; }
            set { _side = value; }
        }

        public PictureBox PicCanMove
        {
            get { return _picCanMove; }
            set { _picCanMove = value; }
        }

        public Square()
        {
            _row = -1;
            _col = -1;
            _state = false;
            _value = 0;
            _piece = "";
            _side = 0;
        }

        public void Init(int row, int col, string piece, int value, int side, bool state)
        {
            _row = row;
            _col = col;
            _piece = piece;
            _value = value;
            _side = side;
            _state = state;
        }

        public void InitPic(int row, int col)
        {
            _picCanMove = new System.Windows.Forms.PictureBox();
            _picCanMove.Image = Properties.Resources.CanMove;
            _picCanMove.Width = 28;
            _picCanMove.Height = 28;
            _picCanMove.BackColor = Color.Transparent;
            _picCanMove.Cursor = Cursors.Hand;
            _picCanMove.Top = row * 63 + 15;
            _picCanMove.Left = col * 63 + 15;
            _picCanMove.Visible = false;
        }
    }
}
